Repository navigation
Volumes (Z-stacks): the first step of #438 (Spec ADR 0010) [draft until MorphoFeature's P-2 guard and the resolver-5 wave] - #617
Draft
guijacquemet wants to merge 14 commits into
Draft
guijacquemet wants to merge 14 commits into
guijacquemet wants to merge 14 commits into
Conversation
Contributor
Author
|
What ADR 0009's consumer-manifest part would add here (a list, not built; ADR 0009 is Proposed, Spec head
Open point for the owner: whether this lands as one PR after ADR 0009 is accepted, or in two (file, validator and record first; discovery hardening second). Generated by Claude Code |
guijacquemet
pushed a commit
that referenced
this pull request
Dec 2, 2026
- P77: an OME-Zarr volume with two levels is described and read at level 0 only (sizes, steps and planes). - P83: one label value across Z planes, masks, FOVs and time points is one 3-D array per (FOV, mask, t); per-plane reads are keyed with z. - P85: an anisotropic RGB volume keeps its X, Y, Z steps and R, G, B. - Import order in test_notebook_tag_by_repeat_drafts.py (ruff I001). - Plan question 93: consumer rows tested in each consumer; ADR 0009's consumer-manifest part in two pull requests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G3qp99D7wESBQ4D81roLYV
…AGE, fov_scope (Spec ADR 0010) Request gains z_indices (VZ11, VC13) and fov_subset (Spec ADR 0002 AR12, implemented in the same wave, so version 4 is never released, ADR 0010 VZ27). A plane request without z_indices on a volume is A_VOLUME_NOT_SUPPORTED (rule (b)), a Z index a covered image lacks is A_Z_INDEX_NOT_IN_IMAGE, and Provenance.fov_scope records z_indices with a scope_digest over fov_subset, fovs and z_indices. BM5 is kept for explicit planes (VZ16). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… ADR 0010) The description-step refusal z_stack_not_supported is removed (VZ1): a Z-stack is described, tagged and calibrated as a volume, and the notebook's Keep the 3-D stacks option is real (projection stays an explicit choice with no default). The run records per image shape, z_count, t_count, c_count, image_kind, plane_statistics, plane_count (physical planes) and statistics_rows (VC2, VC3), pixel_sizes with the unknown source and the derived W_AXIS_UNCALIBRATED reason (VC4), the derived checks (W_AXIS_UNCALIBRATED, W_MIXED_PLANES_AND_VOLUMES, VC5) and statistics_artifacts (VC1). Histograms and QC are not computed for volumes; a run of volumes only writes no table and removes an earlier one. RunInputs reads the sizes from the manifest, never from rows; histograms(fovs), image_qc(fovs) and require_plane_statistics refuse volumes with VOLUME_STATISTICS_NOT_COMPUTED (VC6); records is internal; read_plane has no default z on a volume and read_image needs volume=True (B2); read_mask_volume (VC9, VZ28); read_objects stays in its selection (VC8); check_consumer applies a consumer's volume_support, mixed_volume_support and requires_calibration (ADR 0009 O9, O10). Unit homogeneity leaves Z out (VC11). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…olume"; docs (ADR 0010) The Axes step asks for an explicit choice for Z-stacks (Keep the 3-D stacks, or write projections) before the roles can be confirmed, and no one-click roles are offered for volumes. The calibration card lists every step recorded with W_AXIS_UNCALIBRATED once the roles are confirmed. The Run step says "not computed: volume" before and after the run, and a run of volumes only shows no table. RunResult.volumes names the volumes. The Z-stack tests now check volumes; the contract, user guide, release check and CHANGELOG are updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ibrated-step warning
The pinned RunInputs API gains histograms(fovs), image_qc, require_plane_statistics,
read_mask_volume and check_consumer, read_plane(z=None) and read_image(volume=); records is
_records. Tests read version 7 manifests ("unknown" sources, the reason key, the acquisition
fields), rewrite older manifests with tests/older_manifests.py, and expect
W_AXIS_UNCALIBRATED for images that state no X or Y size (Spec ADR 0010 VZ18).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… fast unit (ADR 0010 VC11) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- VZ30: W_AXIS_UNCALIBRATED is one run-level object in checks and one
report warning, with the axes and how many images lack each; each
image's pixel_sizes keeps its reason.
- VZ31: a run mixing plane images and volumes is checked at the axis
review (notebook Axes step and keep-or-project card, CLI check) and at
the run, and reported with counts, places and the fix; never refused.
- VZ32: keeping Z-stacks is an explicit choice (run --keep-z-stacks,
Keep the 3-D stacks, RunMode(keep_z_stacks=True)), else
z_stacks_not_chosen before any read; the manifest records z_handling
(null, "kept" or {"projected": method}), checked against the entries.
- VZ33: VOLUME_STATISTICS_NOT_COMPUTED names what is not computed in
words.
- VZ34: R_UNIT_NOT_HOMOGENEOUS compares the confirmed roles other than
Z and T.
Tests follow: run-level checks, KEEP in the volume fixtures, P91 for
the mixed check object, VZ32 and VC11 tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3qp99D7wESBQ4D81roLYV
…ion 93 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G3qp99D7wESBQ4D81roLYV
A 2-D mask of a volume is refused; a plain stack is never read under an unconfirmed role; a binary volume mask with two values is refused file wide; QC rows that miss a plane image or name a volume are refused; a volume_support = "none" test consumer's guard refuses every route before any pixel is decoded; a calibration added after publication refuses the old run and is recorded by the re-run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G3qp99D7wESBQ4D81roLYV
- P77: an OME-Zarr volume with two levels is described and read at level 0 only (sizes, steps and planes). - P83: one label value across Z planes, masks, FOVs and time points is one 3-D array per (FOV, mask, t); per-plane reads are keyed with z. - P85: an anisotropic RGB volume keeps its X, Y, Z steps and R, G, B. - Import order in test_notebook_tag_by_repeat_drafts.py (ruff I001). - Plan question 93: consumer rows tested in each consumer; ADR 0009's consumer-manifest part in two pull requests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G3qp99D7wESBQ4D81roLYV
One value in two FOVs is two objects, read apart; per-plane reads of one object on two planes are keyed by plane, with no row where it is absent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G3qp99D7wESBQ4D81roLYV
The README no longer says Z-stacks are refused; the user guide's Axes step no longer calls Keep the 3-D stacks greyed out, and says the choice is recorded and how a mixed run is reported; the run command's options table lists --keep-z-stacks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G3qp99D7wESBQ4D81roLYV
…title The card showed the whole W_MIXED_PLANES_AND_VOLUMES message as its bold title; it now has a one-line title, with the message and the fix below. Looked at rendered with the notebook's CSS (embed_minimal_html, Chromium). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G3qp99D7wESBQ4D81roLYV
… them' Keeping the stacks as volumes is an equal choice beside projection, so the Axes step's card says both (owner, 3 December 2026); the user guide follows. The CHANGELOG says W_AXIS_UNCALIBRATED is one run-level check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G3qp99D7wESBQ4D81roLYV
guijacquemet
force-pushed
the
feat/volumes-438
branch
from
December 3, 2026 06:46
5546b93 to
044a9bd
Compare
ADR 0009 and ADR 0010 are accepted (MorphoBricks-Spec #55, #57). Only the vendored experiment-v1.md changes (vendor.py); the fixtures are the same. SPEC_COMMIT follows, so drafts written under 232fb38 are refused (spec_commit_mismatch), as at every re-pin; the CHANGELOG says so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G3qp99D7wESBQ4D81roLYV
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this is
The first step of #438, as specified by the proposed Spec ADR 0010 (head
bb8037d), with the minimal part of ADR 0009 (head3376d3e) that the volume hand-off needs. A Z-stack is described, tagged and calibrated as a volume; the hand-off is the one Z gate.ADR rows implemented
Owner decisions
z_stack_not_supportedremoved (header check, axis review,convert);allow_zremoved. The notebook's Keep the 3-D stacks is enabled; Confirm axis roles stays closed until the user keeps the stacks or writes projections (no default). No one-click roles are offered for volumes.image_qcnull,statistics_artifacts = not_computed / all_volumes) and removes an earlier run's tables.W_MIXED_PLANES_AND_VOLUMESat the axis review and at the run, inchecks, the run report and summary, with counts, every image and every condition, biological repeat and imaging unit holding both kinds; never refused.z_handlingrecorded;run --keep-z-stacks/RunMode(keep_z_stacks=True)/ Keep the 3-D stacks, elsez_stacks_not_chosen.W_AXIS_UNCALIBRATEDper entry (reason:x,yon every image;zon volumes only; also forpixels) and once per run inchecks/report with the counts per axis; blocks nothing.RunInputs.read_mask_volume.capabilities_for(volume_support)mapsnone/planes/volumes; BM5 kept for explicit planes.requires_calibrationapplied byRunInputs.check_consumer(...), the consumer's own runtime guard. The early checks atdescribe --consumerand at the run are not built (see Left out).require_plane_statisticsrefuses any scope,patchincluded; the consumer has to call it.image_kindandplane_statistics.Contract
statistics_artifacts, checked against the entries, digests andimage_qcby the writer and the reader.RunInputs.openreads the table only in thecomputedstate. A table or QC file beside anot_computedrun isRUN_FOLDER_STALE. Stale tables are removed (REMOVABLEgains both tables).shape,z_count,t_count,c_count,plane_count(physical planes),statistics_rows.Fovsizes come from the manifest, never from rows.Fov.plane_idsis empty for a volume.file_dict) and the reader. The rows of the table are checked at open: one pertatz = 0per plane image, none for a volume, no foreign row. QC coverage is checked whenimage_qc()reads it.pixel_sizescodec (unknown, the derivedreason, the source/value/unit matrix, unit family). Conversion and projection records are unchanged.checksis derived.RunInputs.openrecomputes it with the description and refuses any difference.histograms(fovs=None),image_qc(fovs=None)andrequire_plane_statistics(fovs), withVOLUME_STATISTICS_NOT_COMPUTEDfromrun_inputs_statistics.refuse_volume_statistics.recordsis now_records.fit_scalingcalls the guard first.read_objectsrefuses a coordinate outsideselection.planes, or a selection of another run.read_mask_volume:tis required on T > 1, memory is checked before any read, labels are checked over the whole volume, and nothing is labelled.check_consumergives a consumer one guard on every route.R_UNIT_NOT_HOMOGENEOUScompares the confirmed roles other thanZandT(size and presence).z_indicestype rules (tuple oftype(i) is int, strictly increasing, ≥ 0,planeonly).z_index_refusals(re-exported fromrun_inputs_request) builds the refusal with the exact message.read_plane(fov, z=None, ...)refuses an omittedzon a volume;read_image(fov, *, volume=False).A_VOLUME_NOT_SUPPORTED, thenA_Z_INDEX_NOT_IN_IMAGE, in the ADR's order.Notebook
W_AXIS_UNCALIBRATEDonce the roles are confirmed.Fixtures and conformance rows as tests (
tests/test_volumes_run.py,tests/test_volumes_handoff.py,tests/test_planes_and_volumes.py,tests/test_volumes_rows.py): P65 (b), P76, P77, P83, P84, P85 (RGB), P90, P95, P98, P59, P60 (a)-(c) and (e), P61 (both variants), P62 (a)-(h), P63, P64, P65 (c), P67, P68, P73, P74, P75, P78, P79, P80, P81, P82, P86, P87, P88, P89, P91, P99, P100.Versioning (accepted, VZ35)
"7", written. Versions 6 and 5 are still read for a new run's inputs (roles, settings, reusable rows), andRunInputs.openrefuses them withRUN_FOLDER_VERSION("run preprocessing again"). Nothing is converted.5. ADR 0002 AR12 (Request.fov_subset,A_FOV_NOT_IN_RUN,Provenance.fov_scope) was not in this code; it is implemented here so thatz_indicescan be recorded infov_scope/scope_digest. Per VZ27 the code goes 3 → 5 and version 4 is never released.0.10.0. The CHANGELOG has "Unreleased (after v0.10.0)".Left out, and why
morphobricks_consumer.toml,describe --consumer, the notebook's consumer pick, the phase 1/phase 2 early checks, pinned re-checks, theconsumer_checkrecord andE_CONSUMER_*. Routing isCapabilities.volume_supportplus each consumer's own guard (RunInputs.check_consumer), so P69 and P70 (early refusals) are not covered.statistics_not_computedbelong to normalization and the consumers. Herefit_scalingrefuses any volume among the FOVs asked.evidence_scope = "per_plane"is not written yet.consumer_check).planesconsumer refusingread_image(volume=True)is that consumer's guard, notcheck_consumer).tests/test_notebook_file.pyandtests/test_notebook_preprocessing_cellpose_file.pypip-install into the running environment (Notebook kernel tests must not pip install into the environment running them #614).Owner questions: answered (2 December 2026, ADR 0010 VZ30-VZ35, Spec head
bb8037d)The round-6 answers are built in this PR (commits
7cd4be2,9d8c1a8; recorded as plan §12 question 93).7, resolver5, AR12 in this PR – accepted (VZ35, VZ27).ZandT, so a plain stack confirmedZYXjoins a unit ofYXimages (test_vc11_a_plain_stack_confirmed_zyx_joins_a_unit_of_plane_images).convertwithout--projectkeeps volumes as named-axis copies – accepted (VZ35).z_handling(null,"kept"or{"projected": method}), derived from the entries andprojectionand refused when it disagrees. Keeping is explicit with no default: notebook Keep the 3-D stacks,run --keep-z-stacks(newcli_volumes.py),RunMode(keep_z_stacks=True), or the earlier run's"kept"; otherwise the run stops before any read with the errorz_stacks_not_chosen(user guide §8).W_AXIS_UNCALIBRATEDis one run-level warning (VZ30): onechecksobject (axis: null,countsper axis lacking a step, every such image once withsource: null) and one report warning; each image'spixel_sizeskeepsunknown/pixelswith thereason.RunInputs.check_consumeris public – accepted (VZ35).W_MIXED_PLANES_AND_VOLUMESis now raised at the axis review (axis_review.early_mixed_warning: the notebook's Axes step and keep-or-project card, CLIcheck), then at the run with canonical places (replacing the early folder-based one), inchecks, the report and the run summary, with counts, places, what it means downstream (MorphoFeature refuses it) and the fix.Owner answers on this PR (2 December 2026, recorded in plan §12 question 93)
508871d).consumer_checkfirst; the discovery hardening second.I001import order is fixed in this PR.Tests against the base
Both runs:
-n 8,tests/test_notebook_file.pyandtests/test_notebook_preprocessing_cellpose_file.pyexcluded, normalization62eb84e(the v0.10.0 code), Python 3.13; fiberfeatures not installed here.feat/plane-histograms-v6c9f8891508871dtest_notebook_cellpose_form,test_notebook_cellpose_preview×2,test_notebook_cellpose_app). The base ran from a worktree withPYTHONPATH=src, and a fresh kernel imports the editable install (this branch), so they come from that setup, not from the base code.tests/test_he_tissue_consumer_gate.pytests skip here (no fiberfeatures). With an installed fiberfeatures pinningSUPPORTED_RESOLVER_VERSIONS = {3}they fail on resolver 5, as before; they pass once fiberfeatures re-pins to{5}.checksobject (test_p91_a_mixed_check_that_differs_from_the_entries_is_refused).test_spec_refval_crosscheck.py::test_the_mutations_reach_every_error_code_of_phases_4_and_5failing while I switched branches mid-run; it passes alone and in the clean run above.ruff check,ruff format --checkandtools/check.py --rulespass (with ruff 0.17.6; theI001intests/test_notebook_tag_by_repeat_drafts.pyit reports on the base is fixed here, owner's choice).What other repositories need
SUPPORTED_RESOLVER_VERSIONS = {5};RunInputs.records;histograms(fovs);require_plane_statisticsbefore any fit, application, QC or reuse (VC6);selection.planes(VC8);FileEntry.plane_countas physical planes (statistics rows arestatistics_rows);pixel_sizessourcesunknownandreason.volume_support = "none";histogram_fit.pycallsinputs.histograms()with no argument, which is now refused on a run with any volume.io/run_source.pyreads everyzofrange(fov.z_count)withread_plane. That expands Z implicitly, which ADR 0010 forbids; it must usez_indicesor refuse volumes.run_open.pycallsinputs.histograms()with no argument (refused on volume runs);require_plane_statisticsfirst.volume_support = "volumes",read_image(fov, volume=True),read_mask_volume, in the resolver-5 wave; the 3-D optical-flow brick (LabConstrictor-OpticalFlow3D) will consume runs the same way;section_by = "calibration_unit"must refuseunknownand never read it aspixels(I6);{5}: the 2 failingtest_he_tissue_consumer_gatetests here run the installed fiberfeatures.A_Z_INDEX_NOT_IN_IMAGEout ofPROPOSED_CODES;tools/fov_scope_spec.pygoldens forz_indices(VC16).Generated by Claude Code